USE [Clinic]
GO
/****** Object:  StoredProcedure [dbo].[up_UrinaDelete]    Script Date: 01/30/2008 15:06:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[up_RUEDelete]
	  @RUEID int
	
AS
BEGIN
	SET NOCOUNT ON;
	DELETE FROM [RUE]
	WHERE [RUEID] = @RUEID
END

/******    ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[up_RUEGetAllByPatientID]
	  @PatientID int
	
AS
BEGIN
	SET NOCOUNT ON;
	SELECT *
	FROM [RUE]
	WHERE 
		[PatientID] = @PatientID
END

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[up_RUEInsert]
		  @RUEID int
		, @MM nvarchar(50)
		, @Date smalldatetime
		, @patientID int
AS
BEGIN
	SET NOCOUNT ON;
	INSERT INTO [RUE]
	(
		  [MM]
		, [Date]
		, [patientID]
	) 
	VALUES 
	(
		 
		  @MM
		, @Date
		, @patientID
	)		
END

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[up_RUEUpdate]
		  @RUEID int
		, @MM nvarchar(50)
		, @Date smalldatetime
		, @patientID int
AS
BEGIN
	SET NOCOUNT ON;
	UPDATE [RUE]
	SET 
		  [MM] = @MM
		, [Date] = @Date
		, [patientID] = @patientID
	WHERE 
		[RUEID] = @RUEID
END